import {
	defineConfig
} from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import AutoImport from 'unplugin-auto-import/vite'
import {
	resolve
} from 'path'

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [
		uni(),
		AutoImport({ // 使用
			include: [
				/\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
				/\.vue$/,
				/\.vue\?vue/, // .vue
			],
			imports: [
				"vue",
				"uni-app",
			],
		}),
	],
	resolve: {
		alias: {
			'@': resolve(__dirname, 'src')
		},
		extensions: ['.js', '.ts', '.json', '.tsx'],
	},
	css: {
		preprocessorOptions: {
			scss: {
				silenceDeprecations: ["legacy-js-api"],
			}
		},
		postcss: {
			plugins: [require("tailwindcss"), require("autoprefixer")],
		},
	}
})